Platform Explorer / Nuxeo Platform 2023.9

Component org.nuxeo.elasticsearch.ElasticSearchComponent

Requirements

Resolution Order

784
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

765 (Declared Start Order: 50)
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.elasticsearch.ElasticSearchComponent

Services

Extension Points

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.elasticsearch.ElasticSearchComponent" version="1.0">
  <require>org.nuxeo.ecm.core.repository.RepositoryServiceComponent</require>
  <implementation class="org.nuxeo.elasticsearch.ElasticSearchComponent" />

  <service>
    <provide interface="org.nuxeo.elasticsearch.api.ElasticSearchService" />
    <provide interface="org.nuxeo.elasticsearch.api.ElasticSearchIndexing" />
    <provide interface="org.nuxeo.elasticsearch.api.ElasticSearchAdmin" />
  </service>

  <extension-point name="elasticSearchEmbeddedServer">
    <documentation>
      Extension point to setup an embedded Elasticsearch instance.

      It creates a local node using the same JVM as Nuxeo.

      This is a test configuration and must NOT be used in production,
      it is limited to one shard and no replica.

      <code>
        <elasticSearchLocal clusterName="MyCluster" httpEnabled="true" indexStoreType="mmapfs" nodeName="MyNuxeo"
                            pathData="/var/lib/nuxeo/elasticsearch/" />
      </code>

      Please refer to the Elasticsearch node configuration

      clusterName is the cluster.name

      nodeName is the node.name, default to nuxeoNode

      pathData is the path.data

      indexStoreType is the index.store_type

      httpEnabled is the node.enable_http

    </documentation>

    <object class="org.nuxeo.elasticsearch.config.ElasticSearchEmbeddedServerConfig" />
  </extension-point>


  <extension-point name="elasticSearchClient">
    <documentation>
      Extension point to define how to access the Elasticsearch cluster.

      For the TransportClient protocol:
      <code>
        <elasticSeachClient class="org.nuxeo.elasticsearch.client.ESTransportClientFactory">
          <option name="addressList">localhost:9300</option>
          <option name="clusterName">elasticsearch</option>
          <option name="clientTransportSniff">false</option>
          <option name="clientTransportIgnoreClusterName">false</option>
          <option name="clientTransportPingTimeout">5s</option>
          <option name="clientTransportNodesSamplerInterval">5s</option>
        </elasticSeachClient>
      </code>

      For a Rest client:
      <code>
        <elasticSeachClient class="org.nuxeo.elasticsearch.client.ESRestClientFactory">
          <option name="addressList">localhost:9200</option>
        </elasticSeachClient>
      </code>

    </documentation>
    <object class="org.nuxeo.elasticsearch.config.ElasticSearchClientConfig" />
  </extension-point>

  <extension-point name="elasticSearchIndex">
    <documentation>
      Extension point used to setup an Elasticsearch index.

      The one used to index Nuxeo documents must be of type "doc".

      <code>
        <elasticSearchIndex name="nuxeo" create="true" type="doc">
          <settings></settings>
          <mapping></mapping>
          <fetchFromSources>
            <include>ecm:*</include>
            <include>dc:*</include>
            <exclude>ecm:binaryFulltext</exclude>
          </fetchFromSources>
        </elasticSearchIndex>
      </code>

      @Since 5.9.3
      name is the Elasticsearch index name.

      type is the Elasticsearch type that hold a mapping, "doc" is the mapping
      for Nuxeo documents

      create can be set to false if you don't want Nuxeo to initialize the index
      and mapping.

      settings the Elasticsearch settings
      @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html

      mapping the Elasticsearch mapping for the type
      @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping.html

      @Since 5.9.5
      fetchFromSources, include a list of field name pattern that will be included
      when fetching document from Elasticsearch (@see NxQueryBuilder.fetchFromElasticsearch)
      use the exclude list to prevent returning fulltext or long fields.

    </documentation>

    <object class="org.nuxeo.elasticsearch.config.ElasticSearchIndexConfig" />
  </extension-point>

  <extension-point name="elasticSearchDocWriter">
    <documentation>
      Extension point used to setup the writer used when a document is indexed.
      Must extend the JsonESDocumentWriter class.

      <code>
        <writer class="org.nuxeo.elasticsearch.io.JsonESDocumentWriter" />
      </code>

    </documentation>
    <object class="org.nuxeo.elasticsearch.config.ElasticSearchDocWriterDescriptor" />
  </extension-point>


  <extension-point name="elasticSearchHints">
    <documentation>
      Extension point used to define the NXQL hints which enables the use of Elasticsearch operators.
      Must implement the ESHintQueryBuilder interface.

      @see https://doc.nuxeo.com/nxdoc/nxql/#elasticsearch-nxql-hints to have the available ES hints.

    </documentation>
    <object class="org.nuxeo.elasticsearch.config.ESHintQueryBuilderDescriptor" />
  </extension-point>


</component>